<template>
	<div class="result">
		<span v-if="type=='success'" class="result-icon result-icon-success">✔</span>
		<span v-if="type=='failed'" class="result-icon result-icon-failed">×</span>
		<p class="result-text">
			{{text}}
		</p>
		<p class="result-sub-text">
			{{subText}}
		</p>
	</div>
</template>

<script>
	export default {
		props: {
			'type' : {
				type: String,
				default: 'success'
			},
			'text' : {
				type: String,
				default: '操作成功'
			},
			'sub-text': String
		}
	}
</script>

<style lang="scss" scoped>
	.result {
		text-align: center;
		.result-icon {
			font-size: 40px;
			display: inline-block;
			color: white;
			width: 80px;
			height: 80px;
			line-height: 80px;
			border-radius: 50%;
			&.result-icon-success {
				background-color: #5CA4FD;
				box-shadow: 0 0  0 30px  #EBF3FE;
			}
			&.result-icon-failed {
				background-color: #ff557f;
				box-shadow: 0 0  0 30px  #ffd8d9;
			}
		}
		.result-text {
			margin-top: 60px;
			font-size: 30px;
		}
		.result-sub-text {
			font-size: 14px;
			color: #999;
		}
	}
</style>